
import { ref } from 'vue';


export const useDotNetBridge = () => {
  return window.dotNetBridge || window.chrome.webview.hostObjects.dotNetBridge;
}

export const useRecipeBridge = () => {
  return window.recipeBridge || window.chrome.webview.hostObjects.recipeBridge;
}
export const useLogBridge = () => {
  return window.logBridge || window.chrome.webview.hostObjects.logBridge;
}
export const useDataLogBridge = () => {
  return window.dataLogBridge || window.chrome.webview.hostObjects.dataLogBridge;
}


export const arrTotreeNode = (arr) => {
  return arr.map(item => {
    return {
      key: item.id,
      title: item.name,
      value: item.id,
      checkable: true,
      children: arrTotreeNode(item.children)
    }
  })
}

export const windowWidth = ref(window.innerWidth);
export const windowHeight = ref(window.innerHeight);
